package phase01.module2.code.question2;

import phase01.module2.code.question2.exceptions.InvalidLocationException;

public class Player extends Person {
    private final int level;
    private final Pawn pawn;
    private final Board board;

    public Player(String name, int age, int level, Pawn pawn, Board board) {
        super(name, age);
        this.level = level;
        this.pawn = pawn;
        this.board = board;
    }

    public boolean play(Coordinate coordinate) throws InvalidLocationException {
        return board.play(this, coordinate);
    }

    public int getLevel() {
        return level;
    }

    public Pawn getPawn() {
        return pawn;
    }
}
